package cn.ckx.coding.handler;

import lombok.extern.slf4j.Slf4j;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import java.lang.reflect.Method;

/**
 * 未捕捉的异步异常处理器
 * @author kunxin.cai
 */
@Slf4j
public class AppAsyncUncaughtExceptionHandler implements AsyncUncaughtExceptionHandler {
    
    @Override
    public void handleUncaughtException(Throwable throwable, Method method, Object... objects) {
        log.error("异步线程异常，异常对象；{}，异常消息：{}，异常方法；{}，异常入参：{}",
                throwable, throwable.getMessage(), method.getName(), objects);    
    }
    
}
